WHICH

Section: User Commands (1)
Updated: 12 Mar 93 (v1.0)
Index Return to Main Contents
 

NAME

which - locate commands  

SYNOPSIS

which command [ command ... ]  

ARGUMENTS

command
Command or list of commands to locate.
 

DESCRIPTION

which checks, in order, a list of internal command-shell commands, the current directory, and directories specified in the user's PATH variable for the commands given as its arguments. If a given command is found, its full path is printed; otherwise a ``not found'' message is printed with a list of the directories which were checked. In the case the command is an internal shell command, a message to this effect is printed in lieu of a path.

which respects the shell precedence of command extensions; thus more.com is listed instead of more.exe, should both exist in the same directory. Likewise, .exe files have precedence over .cmd files, and .cmd files over .bat files. A command with a dot in its name has precedence over any default extension; for example, list.old is found before list.old.exe.  

EXAMPLE

The following command lists the locations of four commands:

which dir format unzip zipinfo

dir: OS/2 command-shell internal command
c:\os2\format.com
c:\utils\32\unzip.exe
no zipinfo in . c:\os2 c:\utils\32 c:\utils\16 c:\utils\bnd
  c:\os2\system c:\emx\bin c:\groff\bin c:\os2\mdos\winos2
  c:\os2\install c:\ c:\os2\mdos c:\os2\apps c:\ibmtk\os2bin
  c:\ibmwf\bin c:\ibmc\bin
 

SEE ALSO

csh(1)  

BUGS

The list of internal shell commands is static and does not reflect differences between various versions, including third-party shells such as 4OS2 (or 4DOS).  

AUTHOR

Greg Roelofs (also known as Cave Newt). The makefile was liberally borrowed from Kai Uwe Rommel's UnZip makefile.


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
EXAMPLE
SEE ALSO
BUGS
AUTHOR

This document was created by man2html, using the manual pages.
Time: 20:33:46 GMT, February 01, 2023